<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/11/2
 * Time: 13:42
 */
    session_start();

    $user = require '../conf.php';
    if (@$_POST['user'] == $user['user'] && $_POST['password'] == $user['password'] ){
        $_SESSION['user'] = ['username' => $_POST['user'],
                            'password'  => $_POST['password']
        ];
        header("Location: admin.php");
    }

?>
<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <title>后台登录</title>
</head>
<body background="../img/bj1.jpg">
<div style="margin: 10% 30%;color: wheat">
    <h2>后台登录</h2>
    <form method="post" action="">
        <br>
        <label>用户名：</label>
        <input type="text" name="user" class="form-control" id="exampleInputPassword3" placeholder="用户名" style="width: 500px"><br>
       <label> 密码：</label>
        <input type="password" name="password" class="form-control" id="exampleInputPassword3" placeholder="密码" style="width: 500px"><br>
        <button type="submit"  class="btn btn-danger">登录</button>
    </form>
</div>
</body>
</html>
